<!doctype html>
<html>
<head><meta charset="utf-8"/>
</head>
<body>
<center>
    <table border="1px" width="800px" style="text-align:center">
        <tr>
            <th>名称</th>
            <th>图片</th>
            <th>大小</th>
            <th>类型</th>
            <th>操作</th>
        </tr>
        <tr>
<?php
$files="./pic/suolue/";
$file = opendir($files);

while(false!=($read = readdir($file))){
    if($read == '.' || $read == '..'){
        continue;
    }
    echo '<tr><td>'.$read.'</td>';
    echo "<td><img src='./pic/suolue/$read'/></td>";
    echo '<td>'.round((filesize("./pic/suolue/{$read}")/1024),2).'KB</td>';
    //获取文件类型
    $str2 = pathinfo($files.$read);
    //获取文件类型结束
    echo '<td>'.$str2['extension'].'</td>';
    echo "<td><a href='doaction.php?id={$read}'>删除</a>&nbsp;<a href='index.php?iq={$read}'>编辑</a></td>";
}
closedir($file);
?>
        </tr>
    </table><br>
    <form action="add.php" method="post" enctype="multipart/form-data">
    上传图片：<input type="file" name="upic[]" multiple>&nbsp;<input type="submit" value="上传"/>
    </form>
    <br><br>

    <?php

    if(!empty($_GET['iq'])){
    echo <<<sss
    <form action="new.php" method="get">
        原文件名：<input type="text" name="good" value="{$_GET['iq']}" readonly="readonly"/><br><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;更改文件名：<input type="text" name="god"/>
        <input type="submit" value="确认更改"/>
    </form>
sss;

    }
    ?>
</center>
</body>
</html>